package com.app.service.impl.ajaxservice;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.app.dao.ICornDbDao;
import com.app.service.BaseService;
import com.app.service.IAjaxService;
import com.app.service.vo.CornDbDnaVo;

public class AutocompleteImpl extends BaseService implements IAjaxService {
	private ICornDbDao corndao;
	@Override
	public Map<?, ?> execute(HttpServletRequest request) {
		Map<String,List<String>> params = new HashMap<String,List<String>>();
		List<String> dnaNames = new ArrayList<String>();
		List<String> dnaCoders = new ArrayList<String>();
		List<String> dnaSources = new ArrayList<String>();
	
		List<CornDbDnaVo> _list = corndao.getAll();
		for(CornDbDnaVo c:_list){
			dnaNames.add(c.getDnaName());
			dnaCoders.add(c.getDnaCoder());
			dnaSources.add(c.getDnaSource());
		}
		params.put("dnaName",dnaNames );
		params.put("dnaCoder",dnaCoders);
		params.put("dnaSource",dnaSources);
		return params;
	}
	public ICornDbDao getCorndao() {
		return corndao;
	}
	public void setCorndao(ICornDbDao corndao) {
		this.corndao = corndao;
	}
	
}
